import request from '@/utils/request'

// 登录方法
export function login(username, password, code, uuid) {
    const data = {
        username,
        password,
        code,
        uuid
    }
    return request({
        url: '/login',
        method: 'post',
        params: data
    })
}

// 获取用户详细信息
export function getInfo() {
    return request({
        url: '/getInfo',
        method: 'get'
    })
}

// 退出方法
export function logout() {
    return request({
        url: '/logout',
        method: 'post'
    })
}

// 获取验证码
export function getCodeImg() {
    return request({
        url: '/captchaImage',
        method: 'get'
    })
}

//手机登录
export function loginIphone(phonenumber, code, uuid) {
    const data = {
        phonenumber,
        code,
        uuid
    }
    return request({
        url: '/phonenumberLogin',
        method: 'post',
        params: data
    })
}

//短信验证码
export function getMessageCode(query) {
    return request({
        url: '/captchaSMS',
        method: 'get',
        params: query
    })
}

//登录短信验证码
export function getLoginMessageCode(query) {
    return request({
        url: '/loginCaptchaSMS',
        method: 'get',
        params: query
    })
}

export function editPassword(phonenumber, password, code, uuid) {
    const data = {
        phonenumber,
        password,
        code,
        uuid
    }
    return request({
        url: 'editPassword',
        method: 'post',
        params: data
    })
}